<?php
include 'inc/connect.php';
ini_set('max_execution_time', 3000);
ini_set('display_errors', 0);
//$date = $_GET['date'];
$filename = "Reimbursement-".$date.$alias;
/* 
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-type: application/vnd.ms-excel;charset:UTF-8");
header("Content-Disposition: attachment;Filename=$filename.xls");  

*/

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function goBack()
  {
  window.history.back();
  }
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reimbursement</title>
<script type="text/javascript" src="fxheader1.js"></script>
<style>
.style123 {font-size: 11px; color: #FFFFFF; font-weight: bold; font-family:Tahoma, Geneva, sans-serif; }

.style124 {font-size: 11px;font-family:Tahoma, Geneva, sans-serif; }

</style>
</head>

<body>

<!-- <img src="www.consultants-center/images/ft.png"/> -->

 <img src="images/ft.png"/> 
<table cellspacing="5" cellpadding="5" style=" font-family:Tahoma, Geneva, sans-serif; font-size:11px;" align="left" width="120%">
<tr> 
    <td colspan="10" width="">
    <h1><strong>REIMBURSEMENT FORM</strong></h1>
    </td>
</tr>
<tr>
    	<td>&nbsp;
        
        </td>
    </tr> 
</table>
<table cellspacing="5" cellpadding="5" style=" font-family:Tahoma, Geneva, sans-serif; font-size:11px;" align="left">
<tr>
	<td>
    CONSULTANT NAME:
    </td>
    <td colspan="10" align="left">
    <strong><?php echo ucfirst('Ralph Richmond')." ".ucfirst('Gozarin'); ?></strong>
    </td>
</tr>
<tr>    
    <td>
    DESIGNATION
    </td>
    <td colspan="10" align="left">
    <strong><?php echo ucfirst('Technical Consultant'); ?></strong>
    </td>
</tr>
<tr>    
    <td>
    PERIOD:
    </td>
    <td colspan="10" align="left">
    <strong><?php echo date("F Y",strtotime('2013-12-20'));?></strong>
    </td>
</tr>
</table>


<table align="center" cellpadding="3" cellspacing="5" class="blue_table" id="mytable" style="width:120%;  font-size:11px; outline: solid 1px; border: thin solid 1px;" border="1">
    	<tr>
        	<th bgcolor="#6397E2"  style="width: 10%;" ><div align="center" class="style123">DATE</div></th>
            <th bgcolor="#6397E2"  style="width: 10%;" ><div align="center" class="style123">REIMBURSEMENT TYPE</div></th>
            <th bgcolor="#6397E2"  style="width: 10%;" ><div align="center" class="style123">PARTICULARS</div></th>
            <th bgcolor="#6397E2"  style="width: 10%;" ><div align="center" class="style123">PROJECT</div></th>
            <th bgcolor="#6397E2"  style="width: 10%;" ><div align="center" class="style123">BILLABLE</div></th>            
            <th bgcolor="#6397E2"  style="width: 10%;" ><div align="center" class="style123">PAYEE</div></th>
            <th bgcolor="#6397E2"  style="width: 10%;" ><div align="center" class="style123">AMOUNT WITH VAT</div></th>
        </tr>
<?php
$query = "SELECT * from reimbursement where alias = 'rich' and cutoff = '2013-12-20' and post = 'Yes'";
$result = mysql_query($query);

$total = 0;
while ($row = mysql_fetch_array($result))
	{
		$total += $row['amount_vat'];
?>   
		<tr align="center">
        	<td style="width: 10%;" ><?php echo $row['date']; ?></td>
            <td style="width: 10%;" ><?php echo $row['reimbursement_type']; ?></td>
            <td style="width: 10%;" ><?php echo $row['particular']; ?></td>
            <td style="width: 10%;" >
				<?php 
				echo 'Consultants Center';
				?>
            </td>
            <td style="width: 10%;" ><?php echo $row['billable']; ?></td>            
            <td style="width: 10%;" ><?php echo $row['payee']; ?></td>
            <td style="width: 10%;" ><?php echo $row['amount_vat']; ?></td>
        </tr>
<?php
	}
?>    
	<tr>
    	<td style="width: 10%;" colspan="6" align="right" bgcolor="#DDD" style=" background-color:#DDD;">
        	<strong>TOTAL AMOUNT FOR REIMBURSEMENT:</strong>
        </td>
        <td style="width: 10%;"align="center" style="font-size:14px;">
        	<strong><?php
			echo number_format($total,2);
			?></strong>
        </td>
    </tr>  
</table>


<table cellspacing="5" cellpadding="5" style="width: 50%;font-size:11px;" align="left">
<tr>
	<td style="width: 0%;" align="center">
    CONSULTANT NAME:
    </td>
    <td style="width: 55%;" align="center">
    REVIEWED BY:
    </td>
    <td style="width: 70%;" align="center">
    CHECKED BY:
    </td>
    <td style="width: 50%;" align="center">
    APPROVED BY:
    </td>
    </tr>
    <tr>
    	<td>&nbsp;
        
        </td>
    </tr> 
</table>  

<table cellspacing="5" cellpadding="5" style="width: 50%;font-size:11px;" align="left">
<tr align="center">
	<td style="width: 10%;" align="center">
	_________________
    </td>
    <td style="width: 100%;" align="center">
    _________________
    </td>
    <td style="width: 0%;" align="center">
    _________________
    </td>
    <td style="width: 90%;" align="center">
    _________________
    </td>
    </tr> 
</table>  
<?php
if ($_SESSION['type'] != 'Consultant')
{
?>  
<table cellspacing="5" cellpadding="5" style="width: 50%; font-size:11px;" align="left">
<tr align="center">
	<td style="width: 0%;" align="center">
	<?php echo ucfirst('Richmond')." ".ucfirst('Gozarin'); ?>
    </td>
    <td style="width: 85%;" align="center">
    Lorena I. Soriano
    </td>
    <td style="width: 45%;" align="center">
    Corazon B. Viado
    </td>
    <td style="width: 70%;" align="center">
    Chato Baingan
    </td>
    </tr> 
</table>       
<?php
}
elseif ($_SESSION['type'] == 'Consultant')
{
?>
<table cellspacing="5" cellpadding="5" style="width: 50%; font-size:11px;" align="left">
<tr align="center">
	<td style="width: 10%;" align="center">
	<?php echo ucfirst('Ralph Richmond')." ".ucfirst('Gozarin'); ?>
    </td>
    <td style="width: 100%;" align="center">
    <?php
	$array2 = array_unique($pm);
	foreach ($array2 as $value)
		{
		echo $value." / ";	
		}
	?>
    </td>
    <td style="width: 0%;" align="center">
    Lorena I. Soriano
    </td>
    <td style="width: 90%;" align="center">
    Corazon B. Viado
    </td>
    </tr> 
</table> 
<?php
}
?>
</body>
</html>	